<?php 
/////////////////////////////////////////////////////////////////////////////////////		
include "required_code.php"; 

				session_start();
				$ses_user_id =$_SESSION['ses_user_id'];
				$ses_std_id = $_SESSION['ses_std_id'];
				$_SESSION['concept']=$_GET["c"];
				$concept=$_SESSION['concept'];
				
				if($ses_user_id <> session_id() or  $ses_std_id ==''){
					echo "Authentication failed";
					echo "<meta http-equiv='refresh' content='2;URL=index.php' />";
					}    
					
							$query2="SELECT * FROM std_progress WHERE std_id=$ses_std_id";
							$db_result2=db_query($query2);
							$result2=mysql_fetch_array($db_result2);
							//echo $result2['pretest_sts'];
							if($result2['pretest_sts']!=1 || $result2['ls_sts']!=1){
								echo "Redirecting";
								echo "<meta http-equiv='refresh' content='1;URL=progress.php' />";
							}
							else{
								
								
								
		/////////////////////////////////////////////////////////////////////////////////////						
						?>
						
						<table width="800" border="1" align="center" cellpadding="0" cellspacing="0">
						  <tr>
							<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
							  <tr>
								<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
								  <tr>
									<td width="23%" bgcolor="#FFFFFF"><?php include "header.html"; ?></td>
									</tr>
								</table></td>
							  </tr>
							  <tr>
								<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
								  <tr>
								   
									<td width="80%"><table width="100%" border="0" cellspacing="0" cellpadding="0">
									  <tr>
										<td bgcolor="#00CCFF"><table width="100%" border="0" cellspacing="0" cellpadding="0">
										  <tr>
											<td><div align="left"><tt><a href="progress.php">Home</a> &gt; <a href="learning_paths.php">Learning Paths</a> &gt; Concept<?php echo $concept; ?></tt></div></td>
											<td>&nbsp;</td>
											<td><?php include "right_navi.php"; ?></td>
										  </tr>
										</table></td>
									  </tr>
									  <tr>
										<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
										  <tr>
											<td bgcolor="#FFFFFF"><br />
											  <table width="100%" border="0" cellspacing="0" cellpadding="5">
												<tr>
												  <td>
                                                  <table width="100%" border="2" cellspacing="0" cellpadding="0">
                                                    <tr>
                                                      <td><?php
													  $query_materail="SELECT * FROM std_vs_concept WHERE std_id=$ses_std_id AND concept=$concept";
							$db_result2=db_query($query_materail);
							$result2=mysql_fetch_array($db_result2);


													function call_material($c,$m,$ses_std_id){
													?>
                                                    	<table width="80%" border="2" cellspacing="0" cellpadding="0">
  <tr>
    <td>Material <?php echo $m;?> HERE</td>
  </tr>
  <tr>
    <td><form id="form1" name="form1" method="post" action="material_record.php">
      <label>
        <input type="submit" name="button" id="button" value="Submit" />
        <input type="hidden" name="m" value="<?php echo $m; ?>" />
      </label>
    </form></td>
  </tr>
</table>

                                                    <?php
														
													}
													if ($result2['m1']==0)
														call_material($concept,1,$ses_std_id);
													if ($result2['fa1']=='F' && $result2['m1']==1)
														call_material($concept,2,$ses_std_id);
													
                                                      ?></td>
                                                    </tr>
                                                  </table>
                                                  <p><a href="progress.php">HOME</a></p></td>
												</tr>
												<tr>
												  <td></td>
												</tr>
												<tr>
												  <td></td>
												</tr>
											  </table></td>
										  </tr>
										</table></td>
									  </tr>
									</table></td>
								  </tr>
								</table></td>
							  </tr>
							  <tr>
								<td bgcolor="#FFFFFF"><?php include "footer.html"; ?></td>
							  </tr>
							</table></td>
						  </tr>
						</table>
						</body>
						</html>
						<?php
						/////////////////////////////////////////////////////////////////////////////////////		
							$db_close=db_disconnect($db_open);
							}
/////////////////////////////////////////////////////////////////////////////////////		
?>
